﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Perceiveit.Xml;

namespace Perceiveit.Xml.Tests.Linq
{
    public class SimpleChild : Perceiveit.Xml.XEntity
    {
        private static XProperty<int> _id = XProperty.Attribute<int>("id");
        private static XProperty<string> _value = XProperty.Text<string>();

        public int ID
        {
            get { return _id.GetValue(this); }
            set { _id.SetValue(this, value); }
        }

        public string Value
        {
            get { return _value.GetValue(this); }
            set { _value.SetValue(this, value); }
        }

        public SimpleChild()
        {
        }
    }



    public class SimpleChildList : XList<SimpleChild>
    {

        public SimpleChildList()
            : this(new XSimpleFactory<SimpleChild>("simple", Root.XmlNamespace))
        {
        }

        public SimpleChildList(XFactory<SimpleChild> factory)
            : base(factory)
        {
        }
    }
}
